
import Vue from 'vue'
import Vuex from 'vuex'
import {setItem,getItem} from '@/utils/storage.js'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    user:getItem('token'),//用于存储用户token
  },
  mutations: {
    setData(state,data){
       state.user=data
        // console.log(state, '')
        setItem('token',state.user)
        // window.localStorage.setItem('user',JSON.stringify(state.user))
    }
  },
  actions: {
  },
  modules: {
  }
})
